package com.jintian.smart.platform.system.controller;

import com.jintian.smart.kernel.core.domain.ResponseDTO;
import com.jintian.smart.base.api.system.view.DataScopeAndViewTypeVO;
import com.jintian.smart.base.api.system.constant.SystemSwaggerTagConst;
import com.jintian.smart.platform.system.service.DataScopeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 查询支持的数据范围类型
 */
@RestController
@Tag(name = SystemSwaggerTagConst.SYSTEM_DATA_SCOPE)
@RequestMapping("/sys/role/dataScope")
public class DataScopeController {
    @Resource
    private DataScopeService dataScopeService;

    @Operation(summary = "获取当前系统所配置的所有数据范围")
    @GetMapping("/list")
    public ResponseDTO<List<DataScopeAndViewTypeVO>> dataScopeList() {
        return dataScopeService.dataScopeList();
    }
}
